package com.cards_game.simple_ddz.handler;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cards_game.simple_ddz.bean.SimpleDdzBean;
import com.cards_game.simple_ddz.service.StartGameService;

/**
 * @author 郭国辉
 * 
 *     2017年6月22日下午5:59:09
 */
@Controller
public class StartGameHandler {
	@Resource
	private StartGameService startGameService;
	/**
	 * 检验出牌是否符合规则
	 * @param request
	 * @param modelMap
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="dealCards.do", produces = "text/html;charset=UTF-8")
	public List<SimpleDdzBean> dealCards(HttpServletRequest request, ModelMap modelMap){
		String roomId=request.getParameter("roomId");
		List<SimpleDdzBean> cbs=startGameService.dealCards(roomId);
		return cbs;
	}
}
